/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {
    'valid-jsdoc': 'no',
    'security': {
      'csrf': {
        'enable': false
      }
    },
    knex : {
      // database configuration
      client: {
        // database dialect
        dialect: 'mysql',
        connection: {
          // host
          host: 'rm-wz91gcm0zb9z046f5go.mysql.rds.aliyuncs.com',
          // 端口号
          port: '5601',
          // 用户名
          user: 'wx',
          // 密码
          password: 'c8FD4gv4OwxH',
          // 数据库名
          database: 'wx_mobuz',
        },
        // connection pool
        pool: { min: 0, max: 5 },
        // acquire connection timeout, millisecond
        acquireConnectionTimeout: 30000,
      },
      // 是否加载到 app 上，默认开启
      app: true,
      // 是否加载到 agent 上，默认关闭
      agent: false,
    }
  };

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1555313455029_2816';

  // add your middleware config here
  config.middleware = [];
  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};

